home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
lang
/
PPCsmalltalk.lha
/
PPCSmallTalk
/
examples
/
visitor.st
< prev
Wrap
Text File
|
1986-10-19
|
617b
|
35 lines
Class SimulationObject :Object
| sizeDist waitDist |
[
init
sizeDist <- Binomial new initialize events: 5 mean: 0.4.
waitDist <- Random new "uniform distribution"
| size
^ sizeDist next
| wait: sizeGroup "uniform distribution from 1 to 6"
^ waitDist next * sizeGroup * 6
]
Class Visitor :SimulationObject
| sizeGroup wait alreadyEaten |
[
initialize: superClass
sizeGroup <- superClass size.
wait <- superClass wait: sizeGroup.
alreadyEaten <- false
| entering
(alreadyEaten == false)
ifTrue: [alreadyEaten <- true. ^ true].
^ false
| time
^ wait
| groupSize
^ sizeGroup
]